var express = require('express');
var router = express.Router();
var query = require('./Database');

/* GET home page. */
router.get('/', function(req, res, next) {
    res.render('ProRecord', {});
});
router.post('/record',async (req,res,next)=>{
    let score = req.body;
    let rows = await query("select * from score where userid = " + score.userid + " and recordsco<0 order by id desc;");
    let data = [{code:100},rows];
    res.send(data);
});
module.exports = router;